#include<iostream>
#include"pointlist.h"
using namespace std;
int main(){
	int x,y;
	PointList plA,plB;
	plA.append(Point(0,0));
	plA.append(Point(1,1));
	plA.append(Point(2,2));

	char c;
	cin>>c;
	while(c!='q'){
		switch(c){
		case '#':
			cin>>x>>y;
			plA.insertAtBeginning(Point(x,y));
			plB.insertAtBeginning(Point(x,y));
			break;
		case 'd':
			plA.showStructure();
			plB.showStructure();
			break;
		}
		cin>>c;
	}
	return 0;
}